#include<iostream>
using namespace std;
int f(int a[], int n) {
	int  sum=0;
	for (int i = 0; i <n; i++)
	{
		sum += (a[i] * a[i]);
	}
	return sum;
}

int main() {
	int a[] = { 2,3,4 };
	int x = f(a, 3);
	cout << x << endl;


	
	return 0;
}